BaseParser.js ➔ ???   A
last analyzed

Complexity

Conditions 2
Paths 1

Size

Total Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 2
c 1
b 0
f 1
nc 1
nop 1
dl 0
loc 11
rs 9.4285
1
const ParametersParser     = require('./2.0/ParametersParser'),
2
      SecuritySchemaParser = require('./2.0/DefinitionsParser'),
3
      ParserInterface      = require('./ParserInterface')
4
5
/**
6
 * @ignore module.exports
7
 * @ignore exports
8
 */
9
10
/**
11
 * Base class for swagger parser
12
 * @class BaseParser
13
 *
14
 * @property {MethodsParser} methodParser Methods parser
15
 * @property {SecuritySchemaParser} schemaParser Parser for security schema
16
 */
17
class BaseParser extends ParserInterface {
18
19
  constructor (data) {
20
    super()
21
22
    if (new.target === BaseParser) {
23
      throw new TypeError('Cannot construct Abstract instances directly')
24
    }
25
26
    this.data         = data
27
    this.paramParser  = new ParametersParser()
28
    this.schemaParser = new SecuritySchemaParser()
29
  }
30
}
31
32
module.exports = BaseParser